Skip to main content

Build your feed id


Build Your Feed ID

To use Pragma V2, you first need to construct your feed ID based on the specific data you require. The feed ID is a packed encoding of the asset class, feed type, feed variant, and pair ID.

Asset Class

The first two bytes of the feed ID represent the asset class. Below is a list of available asset classes. More will be added based on demand.

Asset ClassEncoding
CRYPTO0x0000

Feed Type

The following byte is reserved for the feed type. Currently, only SPOT is supported, but additional feed types are planned.

Feed TypeEncoding
SPOT0x00
TWAP0x01
REALIZED VOLATILITY0x02
OPTIONS0x03
PERP0x04

Feed Type Variant

The next byte specifies the feed type variant.

Feed Type VariantEncoding
UNIQUE0x00

Pair ID

Below is the list of available ticker pairs, along with their pair ID, decimals, mainnet availability, and risk level.

TickerPair IDDecimalsMainnetRisk
BTC/USD0x4220a04d5043c48L
ETH/USD0x454e5f9a0a2c248L
WBTC/USD0x572f26b85070a4e48M
WBTC/BTC0x572f26b8505427438M
BTC/EUR0x42209c98c4d6d28L
WSTETH/USD0x59b5ad29d7e28e80e44848M
LORDS/USD0x4f080d2de3cfebdbe4c8H
UNI/USD0x5544b51e220f548M
STRK/USD0x537b7d79bbab0c648L
ZEND/USD0x5a5565c82ebcf69c8H
NSTR/USD0x4e67c5a3a95b9c148H
EKUBO/USD0x477a0c2f264f56ce948H
USDT/USD0x55691d82482b94146L
DAI/USD0x44322ef3fbf2d48M
USDC/USD0x55691d7069d067f46L
LUSD/USD0x4c820c85d853c5048H

Example

To retrieve the SPOT MEDIAN UNIQUE feed for BTC/USD, the corresponding feed ID would be:
0x000000000000000000000000000000000000000000000000004220a04d5043c4